package com.example.servicemodule;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

public class CustomizeTextView extends TextView {
    private static final String TAG = "CustomizeTextView";

    private Context mContext;

    public CustomizeTextView(Context context) {
        super(context);
        mContext = context;
    }

    public CustomizeTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        mContext = context;
    }

    public CustomizeTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mContext = context;
    }

    public CustomizeTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        mContext = context;
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.scale_anim);
        startAnimation(animation);
        Log.i(TAG, "onLayout: ");
    }
}
